﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CanSWAT.SWAT
{
    class SnowRedistributionParameterFile : SingleParameterFile
    {
        public SnowRedistributionParameterFile(string file) 
            : base(file)
        {
        }

        public override string Description
        {
            get { return "Snow Redistribution"; }
        }

        public override string DefaultFileName
        {
            get { return "snow.txt"; }
        }

        /// <summary>
        ///1       |code: 0=no redistribution, 1=redistribution
        ///3       |sr_print: print code, 0=print snow water equivalent of the watershed, 1=print SWE of each HRU
        ///106 109 110  |hru_print: output these HRU to snowcomp.txt for comparasion
        ///108     |ztcode : zero tillage code
        ///0.04	   |k1_sd : slope coefficient  , 0.4
        ///0.05    |k2_sd : curvature coefficient, 0.05
        ///7.0	   |ut0 : wind speed for initiating snow redistribution at T=-27 degree (m/s), by default 6.98
        ///30.0	   |u0 : wind speed over which the decay coefficient is 1
        ///27.0	   |t0_sd : air temperature at which Ut = Ut0
        ///0.0033  |aa : empirical coefficient for calculating critical wind speed
        ///20.0	   |swe0 : initial snow water equaverlant (mm)
        ///0.0	   |k_blow : fraction of snow blowing into or out of the watershed, 0.0
        ///25.0	   |shc_crop : snow holding capacity of cropland in mm SWE
        ///0.10    |rsno_fac : rain on snow impact factor (mm/mm/°C/day)
        /// </summary>
        protected override List<SingleParameter> DefaultParameters
        {
            get 
            {
                List<SingleParameter> parameters = new List<SingleParameter>();
                parameters.Add(new SingleParameter("code", "0=no redistribution, 1=redistribution", 1));
                parameters.Add(new SingleParameter("sr_print", "print code, 0=print snow water equivalent of the watershed, 1=print SWE of each HRU", 0));
                parameters.Add(new SingleParameter("hru_print", "output these HRU to snowcomp.txt for comparasion", -1));
                parameters.Add(new SingleParameter("ztcode", "zero tillage code", 108));
                parameters.Add(new SingleParameter("k1_sd", "slope coefficient  , 0.4", 0.04));
                parameters.Add(new SingleParameter("k2_sd", "curvature coefficient, 0.05", 0.05));
                parameters.Add(new SingleParameter("ut0", "wind speed for initiating snow redistribution at T=-27 degree (m/s), by default 6.98", 7.0));
                parameters.Add(new SingleParameter("u0", "wind speed over which the decay coefficient is 1", 30.0));
                parameters.Add(new SingleParameter("t0_sd", "air temperature at which Ut = Ut0", 27.0));
                parameters.Add(new SingleParameter("aa", "empirical coefficient for calculating critical wind speed", 0.0033));
                parameters.Add(new SingleParameter("swe0", "initial snow water equaverlant (mm)", 20.0));
                parameters.Add(new SingleParameter("k_blow", "fraction of snow blowing into or out of the watershed, 0.0", 0.0));
                parameters.Add(new SingleParameter("shc_crop", "snow holding capacity of cropland in mm SWE", 25.0));
                parameters.Add(new SingleParameter("rsno_fac", "rain on snow impact factor (mm/mm/°C/day)", 0.1));

                return parameters;
            }
        }
    }
}
